﻿using Silent.MDB.Common.Data;
using Silent.MDB.Common.Services;
using Silent.WCF.Base;
using Silent.WCF.Base.Common;

namespace Silent.MDB.Server.Model.Services
{
    public class ServiceHostBuilder : ServiceHostBuilderBase
    {
        protected override void AddBehaviors()
        {
            AddBehavior(BehaviorFactory.ServiceThrottlingBehavior);
        }
        protected override void AddEndpoints()
        {
            AddServiceEndpoint<ISystemInfoService>(BindingFactory.DefaultTcpBinding);
            AddServiceEndpoint<IRepositoryService<RootObject>>(BindingFactory.DefaultTcpBinding);
            AddServiceEndpoint<IRepositoryService<Folder>>(BindingFactory.DefaultTcpBinding);
            AddServiceEndpoint<IRepositoryService<Student>>(BindingFactory.DefaultTcpBinding);
            AddServiceEndpoint<IRepositoryService<Teacher>>(BindingFactory.DefaultTcpBinding);
            AddServiceEndpoint<IRepositoryService<Department>>(BindingFactory.DefaultTcpBinding);
            AddServiceEndpoint<IRepositoryService<Cathedra>>(BindingFactory.DefaultTcpBinding);
            AddServiceEndpoint<IRepositoryService<Faculty>>(BindingFactory.DefaultTcpBinding);
        }
    }
}